<!--
 * @Author: Allen
 * @Date: 2021-01-06 16:57:35
 * @Description: 抱怨身处黑暗，不如提灯前行。愿你在自己存在的地方，成为一束光，照亮世界的一角
 * @LastEditTime: 2021-01-06 16:58:04
 * @LastEditors: Allen
 * @FilePath: \WMS\src\components\wms\identify\identify.vue
 * @Additional: 附加类容
-->
<template>
  <section>
    <el-col :span="span" v-if="curIsShow">
      <lableName
        :validrule="validrule"
        :curLabelName="curLabelName"
        :isShowLabel="isShowLabel"
        :isRequire="isRequire"
      ></lableName>
      <el-select
        :multiple="isMul"
        collapse-tags
        :filterable="filterable"
        v-model="modelCode"
        :placeholder="placeholder"
        @clear="clearCode"
        :clearable="clearable"
        @change="sendCode"
        :disabled="curDisabled"
        size="small"
      >
        <el-option
          v-for="item in optionDatas"
          :key="
            item[optionFields.length > 1 ? optionFields[0] : defOptionFields[0]]
          "
          :label="
            item[optionFields.length > 1 ? optionFields[1] : defOptionFields[1]]
          "
          :value="
            item[optionFields.length > 1 ? optionFields[0] : defOptionFields[0]]
          "
          >{{
            item[optionFields.length > 1 ? optionFields[1] : defOptionFields[1]]
          }}</el-option
        >
      </el-select>
      <validateFormate
        :curLabelName="curLabelName"
        :validrule="validrule"
      ></validateFormate>
    </el-col>
  </section>
</template>
<script>
import { orgApis } from "@/api/apiList/org";
import { dropdownMixins } from "@/components/mixins/dropdownMixins";
// import lableName from "@/components/lableName";
// import validateFormate from "@/components/validateFormate";
export default {
  name: "isEnable",
  // 组件混入对象：{props[span,isShowLabel,code,isMul,labenName] data[modelCode,optionDatas,listQuery] methods[queryTable,sendCode]}
  mixins: [dropdownMixins],
  components: {
    lableName: () => import("@/components/lableName"), //标题溢出样式组件
    validateFormate: () => import("@/components/validateFormate") //校验提示样式组件
  },
  props: {
    isMul: { type: Boolean, default: false }
  },
  data() {
    return {
      // 默认绑定数据对象字段
      defOptionFields: ["code", "text"],
      placeholder: this.$t("sys.tips.esTip0"),
      optionDatas: [
        { code: "1", text: "是" },
        { code: "0", text: "否" }
      ],
      curLabelName:
        this.labelName === "" ? this.$t("org.label.isEnableCn") : this.labelName
    };
  },
  mothods: {}
};
</script>

<style scoped>
.el-col-12 {
  width: 100%;
}
</style>
